Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add subPackages #18

Merged
merged 2 commits into from
Sep 21, 2018
Merged

add subPackages #18

merged 2 commits into from
Sep 21, 2018

Conversation

Akiq2016
Copy link
Contributor

@Akiq2016 Akiq2016 commented Sep 20, 2018

  • resolve the sub packages structure in app.json
  • sub packages related dependencies should not add to common.js #19 #22
    async getEntryResource() {
        const appJSONFile = resolve(this.base, 'app.json');
+       const { pages = [], subPackages = [], tabBar = {} } = await readJson(appJSONFile);

        const components = new Set();
        for (const page of pages) {
            await this.getComponents(components, resolve(this.base, page));
        }

+        for (const subPackage of subPackages) {
+            const { root, pages = [] } = subPackage;

+            await Promise.all(pages.map(async page =>
+                await this.getComponents(components, resolve(this.base, join(root, page)))
+            ));
+        }

        this.getTabBarIcons(tabBar);

        return [
            'app',
            ...pages,
+           ...[].concat(...subPackages.map(v => v.pages.map(w => join(v.root, w)))),
            ...components
        ];
    }

@Cap32 Cap32 merged commit 99d2ac0 into Cap32:master Sep 21, 2018
@Cap32
Copy link
Owner

Cap32 commented Sep 21, 2018

Thanks @Akiq2016 👍🏿

I've released v0.19.0 to npm before the To-Do list completed

@Cap32
Copy link
Owner

Cap32 commented Sep 21, 2018

  • sub packages related dependencies should not add to common.js

I created a new issue ref to it.

@Akiq2016
Copy link
Contributor Author

ok, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants